//
//  SingleDemo.m
//  GCDDemo
//
//  Created by zxs on 2020/4/30.
//  Copyright © 2020 zxs. All rights reserved.
//

#import "SingleDemo.h"

@implementation SingleDemo

// 获取单例对象
+ (instancetype)sharedInstance {
    static dispatch_once_t onceToken;
    static id instance = nil;
    
    dispatch_once(&onceToken, ^{
        instance = [[self alloc] init];
    });
    
    return instance;
}

@end
